<%@ page import="java.util.Vector" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.Calendar" %><%--
  Created by IntelliJ IDEA.
  User: acer
  Date: 2024/9/19
  Time: 17:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>使用application内置对象--checkMessage.jsp</title>
</head>
<body bgcolor="#abcdef">
<%!Vector<String>v = new Vector<>();
    int i =0;%>
<%
    String datetime = new SimpleDateFormat("yyy-MM-dd hh:mm:ss").format(Calendar.getInstance().getTime());//获取时间
%>
<%
    request.setCharacterEncoding("utf-8");
    String name = request.getParameter("name");
    String title = request.getParameter("name");
    String message = request.getParameter("message");
%>
<%
    if (name==null ll"".equals(name.trim())){
        name = "网友" + (int)(Math.random()*10000+ 10000);
    }
    if (title == null ll"".equals(title.trim())){
        title= "无";
    }
    if (message == null ll"".equals(message.trim())){
    message= "无";
    }
%>
<%
    i++;
    String str = "第" +"<span class=span0>" +i+"</span>"+"楼"
    +".<span calss=span3>内容:</span><br>" +message
    +".<spancalss=span4>时间:</span>"+datetime+".<hr>";
    v.add(str);
    application.setAttribute("message",v);
%>
<a href="inputMessage.jsp">返回留言板</a>
<a href="inputMessage.jsp">返回留言板</a>
</body>
</html>
